package com.genokon.consumer.service;

import com.genokon.consumer.fallback.EchoServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author by baichaoda
 * @Date 2020/7/23 14:04
 */
@FeignClient(name = "service-provider", fallbackFactory = EchoServiceFallbackFactory.class)
public interface EchoService {
    /**
     * echo
     * @param str s
     * @return s
     */
    @GetMapping("/echo/{str}")
    String echo(@PathVariable("str") String str);

    /**
     * divide
     * @param a param a
     * @param b param b
     * @return s
     */
    @GetMapping("/divide")
    String divide(@RequestParam("a") Integer a, @RequestParam("a") Integer b);
}
